The manipulation pipeline has been released; THIS DEMO PAGE IS NOW DEPRECATED. For current information on the manipulation pipeline, and information about how to execute pick and place tasks using ROS and the PR2 see the pr2_tabletop_manipulation_apps stack page and the pr2_pick_and_place_demos package.
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Set up the source code tree for the ICRA manipulation demo
Description: Easy-to-follow instructions for downloading and building all the code you need for the manipulation demo on a robot.Tutorial Level:
Contents
The source code for the ICRA Manipulation Demo contains:
object_grasping_app: trunk with specific revision (05/25, used at launch party)
arm navigation stacks: trunk with specific revisions (05/24)
point_cloud_perception: trunk with specific revision; pr2_teleop_booth: trunk head revision
rest of codebase: latest with specific revisions (04/16)
These instructions assume you have a brand new account on a robot.
At the end, we will have installed in the following directories, with self-descriptive names:
~/ros_sandbox ~/ros_sandbox/versioned_latest ~/ros_sandbox/trunk_arm_navigation ~/ros_sandbox/trunk_others ~/ros_sandbox/object_grasping_app
Rosinstall
Do not use the rosinstall that you get from ros.org via wget, it seems it is deprecated. Instead, use the new version of rosinstall that gets installed as a system command:
sudo apt-get install python-setuptools sudo easy_install rosinstall
If you have the old version of the rosinstall python script lingering somewhere in your system, delete it before running the above commands.
Prepare the base directory for the installation:
mkdir ~/ros_sandbox
Entire codebase from latest (specific revisions)
Use the following rosinstall script to get specific versions for all the codebase
rosinstall ~/ros_sandbox/versioned_latest http://vault.willowgarage.com/wgdata1/vol1/icra_manipulation/versioned_latest.rosinstall
(Note: currently, I have copied this rosinstall script onto vault.willowgarage.com, maybe it should reside on ros.org along with the arm_navigation script below, but I do not know how to place it there)
Arm navigation from trunk (specific revisions)
Use the following rosinstall script to get the trunk version of all arm navigation stacks:
rosinstall ~/ros_sandbox/trunk_arm_navigation http://vault.willowgarage.com/wgdata1/vol1/icra_manipulation/arm_navigation_dev.rosinstall
Other stacks from trunk (specific revisions)
This currently refers to the point_cloud_perception stack and pr2_teleop_booth. Use the following rosinstall script:
rosinstall ~/ros_sandbox/trunk_others http://vault.willowgarage.com/wgdata1/vol1/icra_manipulation/trunk_others.rosinstall
Object grasping app from trunk (specific revision)
Use the following rosinstall script to get the trunk version of the object grasping app:
rosinstall ~/ros_sandbox/object_grasping_app http://vault.willowgarage.com/wgdata1/vol1/icra_manipulation/object_grasping_app.rosinstall
Setting up the environment
Copy the following into a file called ~/.bashrc.ros.
export ROS_BASE=~/ros_sandbox ; export ROS_ROOT=${ROS_BASE}/versioned_latest/ros ; export PATH=${ROS_ROOT}/bin:${PATH} ; export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH} ; export OCTAVE_PATH=${ROS_ROOT}/core/experimental/rosoct/octave:${OCTAVE_PATH} ; if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://c1:11311 ; fi ; export ROS_PACKAGE_PATH=${ROS_BASE}/versioned_latest/ros-experimental-trunk:${ROS_BASE}/versioned_latest/ros-pkg-unreleased:${ROS_BASE}/versioned_latest/stacks:${ROS_BASE}/versioned_latest/wg-ros-pkg-unreleased export ROS_PACKAGE_PATH=${ROS_BASE}/object_grasping_app:${ROS_BASE}/trunk_arm_navigation:${ROS_BASE}/trunk_others:${ROS_PACKAGE_PATH}; . ${ROS_ROOT}/tools/rosbash/rosbash export ROBOT=pr2 alias bringup='roslaunch pr2_bringup pr2.launch' alias grasp_pipeline='roslaunch grasping_app_launch grasping_pipeline.launch' alias grasp_demo='rosrun grasping_app_executive icra_demo_executive.py' alias grasp_joy='roslaunch pr2_teleop_booth pr2_teleop_manipulation.launch' alias dashboard='rosrun pr2_dashboard pr2_dashboard' alias rviz_grasping='roslaunch pr2_teleop_booth rviz_grasping.launch' alias start_arm='rosrun pr2_controller_manager pr2_controller_manager start r_arm_controller' alias stop_arm='rosrun pr2_controller_manager pr2_controller_manager stop r_arm_controller' alias start_head='rosrun pr2_controller_manager pr2_controller_manager start head_traj_controller' alias stop_head='rosrun pr2_controller_manager pr2_controller_manager stop head_traj_controller' alias cmgr='rosrun pr2_controller_manager pr2_controller_manager' alias mech='rosrun pr2_controller_manager pr2_controller_manager' alias teleop='roslaunch pr2_teleop teleop_joystick.launch'
Edit your .bashrc file. Comment out the following lines:
echo "Sourcing etc/ros/setup.bash" . /etc/ros/setup.bash
Add the following lines:
echo "Sourcing ~/.bashrc.ros" source .bashrc.ros
Log out and log back in. You should be good to go.
Compiling the code
I am not sure if this is actually needed, but I generally make ros first:
roscd make
You will need to build the following packages for the manipulation demo:
rosdep install pr2_bringup pr2_teleop pr2_teleop_booth grasping_app_launch rosmake pr2_bringup pr2_teleop pr2_teleop_booth grasping_app_launch